{extend name="Public/content"/}
{block name="button"}
<button class="layui-btn layui-btn-sm" data-title="添加分类" data-modal="{:U('add')}">添加栏目</button>
{/block}
{block name='content'}
<form class="layui-form" action="__SELF__" data-auto="true" method="post">
    <input type="hidden" name="action" value="resort">
    <table class="layui-table" lay-size='sm' lay-skin="line">
        <thead>
            <tr>
                <th class="list-table-sort-td">
                    <button type="submit" class="layui-btn layui-btn-xs layui-btn-normal">排序</button>
                </th>
                <!--<th class="text-center">图标</th>-->
                <th>分类名称</th>
                <th class="text-center">状态</th>
                <th></th>
            </tr> 
        </thead>
        <tbody>
            {volist name="list" id="vo"}
            <tr>
                <td class="list-table-sort-td">
                    <input type="text" name="_{$vo.id}" value="{$vo.sort}" class="sort-input">
                </td>
                <!--<td class="text-center"><img src="{$vo.icon|default='__PUBLIC__/theme/img/image.png'}" height="17"></td>-->
                <td class="nowrap">{$vo.name|default=''}</td>
                <td class="text-center">
                    {eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{/eq}
                    {eq name='vo.status' value='1'}<span class="color-green">使用中</span>{/eq}
                </td>
                <td>
                    {empty name='vo.pid'}
                    <a data-title="添加子菜单" data-modal="{:U('add')}?id={$vo.id}">添加下级</a>
                    {else/}
                    <span class="color-desc">添加下级</span>
                    {/empty}
                    <span class="text-explode">|</span>
                    <a data-title="编辑菜单" data-modal="{:U('edit')}?id={$vo.id}">编辑</a>
                    <span class="text-explode">|</span>
                    {eq name='vo.status' value='1'}
                    <a data-update="{$vo.ids}" data-field='status' data-value='0' data-action='{:U("forbid")}'>禁用</a>
                    {/eq}
                    {eq name='vo.status' value='0'}
                    <a data-update="{$vo.ids}" data-field='status' data-value='1' data-action='{:U("resume")}'>启用</a>
                    {/eq}
                    <span class="text-explode">|</span>
                    <a data-update="{$vo.ids}" data-field="delete" data-action="{:U('del')}">删除</a>
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
</form>
{/block}
